#include<bits/stdc++.h>
using namespace std;

int main(){
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	freopen("duel.in","r",stdin);
	freopen("duel.out","w",stdout);

	int n;
	cin >> n;
	map<int,int> mp;
	while(n--){
		int x;
		cin >> x;

		mp[x]++;
	}

	int ans = 0, pre = -1;
	bool flag = 0;
	for(const pair<int,int>& p : mp){
		if(pre == -1)
			pre = p.second;
		else{
			if(pre >= p.second)
				ans += pre - p.second;
			else if(flag)
				ans = max(0, ans - p.second + pre);
			pre = p.second;
			flag = 1;
		}
	}
	ans += pre;

	cout << ans;

	return 0;
}